import { getCurrentWindow } from "@tauri-apps/api/window";

const closeFn = async () => {  
  const win = getCurrentWindow();
  if (win.label === 'main') {
    win.listen('tauri://close-requested', function () {
      win.hide();
    });
  }
}

closeFn();